package hello.configuration.restful.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.Validator;

/**
 * @Description:
 * @Author: m01
 * @Date: created at  2018/12/22  14:27
 * @Modified By:
 */
public class AfterDeleteValidator implements Validator {

    @Override
    public boolean supports(Class<?> aClass) {
        System.out.println(" 允许验证所有的 实体类 ");
        return true;
    }

    @Override
    public void validate(Object o, Errors errors) {

        System.out.println(o);
        System.out.println("已 删除数据 无法数据回滚 ");
        errors.reject("123","34");
    }
}
